﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;

namespace Ccit.OA.NewsCenter
{
    public interface ISubmit
    {
        /// <summary>
        /// 根据条件XML获得信息
        /// </summary>
        /// <param name="msClauseAttr"></param>
        /// <returns></returns>
        List<MsNews> GetNewsByClause(MsClauseAttr msClauseAttr, string sColumnNo,string sType);

        /// <summary>
        /// 根据信息ID获得信息明细
        /// </summary>
        /// <param name="sNewsId"></param>
        /// <returns></returns>
        MsNews GetNewsByNewsId(string sNewsId);

        /// <summary>
        /// 根据信息ID获得信息正文
        /// </summary>
        /// <param name="sNewsId"></param>
        /// <returns></returns>
        MsContent GetNewsContentInfo(string sNewsId);

        /// <summary>
        /// 根据信息ID获得浏览记录
        /// </summary>
        /// <param name="sNewsId"></param>
        /// <param name="sUserId"></param>
        /// <param name="sBeginDate"></param>
        /// <param name="sEndDate"></param>
        /// <returns></returns>
        List<MsViewInfo> GetViewInfoByNewsId(string sNewsId, string sUserId, string sBeginDate, string sEndDate);

        /// <summary>
        /// 更改当前置顶状态
        /// </summary>
        /// <param name="sNewsId">信息ID</param>
        /// <param name="sCurrTopFlag">当前置顶状态</param>
        /// <returns></returns>
        bool ChangeTopFlag(string sNewsId, string sCurrTopFlag);

        /// <summary>
        /// 保存信息中心信息
        /// </summary>
        /// <param name="msNews"></param>
        /// <returns></returns>
        string SaveNewsInfo(MsNews msNews,MsContent msContent);

        /// <summary>
        /// 根据选择的信息ID删除信息
        /// </summary>
        /// <param name="sNewsIds"></param>
        /// <returns></returns>
        bool DeleteNewsByIds(string sNewsIds, string sType);

        /// <summary>
        /// 提交或发布信息
        /// </summary>
        /// <param name="sNewsIds"></param>
        /// <returns></returns>
        bool SubmitNewsByIds(string sNewsIds);

        /// <summary>
        /// 根据类型及类型ID获得图片信息
        /// </summary>
        /// <param name="sId"></param>
        /// <param name="sType"></param>
        /// <returns></returns>
        MsImage GetImageByNewsId(string sId, string sType);

        /// <summary>
        /// 上传图片
        /// </summary>
        /// <param name="msImage"></param>
        /// <param name="sNewsId"></param>
        /// <returns></returns>
        string UploadImageByNewsId(MsImage msImage,string sNewsId);

        /// <summary>
        /// 删除图片
        /// </summary>
        /// <param name="sPicId"></param>
        /// <param name="sNewsId"></param>
        /// <returns></returns>
        bool DeleteImage(string sPicId, string sId, string sType);



        /// <summary>
        /// 保存浏览记录
        /// </summary>
        /// <param name="msViewInfo"></param>
        /// <returns></returns>
        bool SaveViewRecord(MsViewInfo msViewInfo);

        /// <summary>
        /// 获得信息浏览记录
        /// </summary>
        /// <param name="sNewsId"></param>
        /// <returns></returns>
        List<MsViewInfo> GetViewInfoByNewsId(string sNewsId, string sUserName);

        /// <summary>
        /// 发布所选的信息(信息管理)
        /// </summary>
        /// <param name="NewsId"></param>
        /// <returns></returns>
        bool PublicNewsByIds(string NewsId);
        
        /// <summary>
        /// 撤销所选择的信息
        /// </summary>
        /// <param name="NewsIds"></param>
        /// <returns></returns>
        bool RevocationNewsByIds(string NewsIds);

        /// <summary>
        ///退回所选信息
        /// </summary>
        /// <param name="NewsIds"></param>
        /// <returns></returns>
        bool ReturnNewsByIds(string NewsIds);

        /// <summary>
        /// 删除所选的信息(信息管理)
        /// </summary>
        /// <param name="NewsIds"></param>
        /// <returns></returns>
        bool RemoveNewsByIds(string NewsIds,string Type);

        /// <summary>
        /// 获取当前用户具有管理权限的信息列表
        /// </summary>
        /// <param name="msClauseAttr"></param>
        /// <param name="Type"></param>
        /// <returns></returns>
        List<MsNews> GetNewsManageList(MsClauseAttr msClauseAttr, string Type);  
    }
}
